<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-menu default-active='active' mode='horizontal' class='menu-unit'>
          <el-menu-item v-for='item in Container2' :index="'采购合同'===item.name?'active':'default'">
            <el-link @click="gotoMenu(item.url)" :type="'采购合同'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
        <table cellpadding="4" cellspacing="0" border="0" width="100%">
          <tr>
            <td class="containerBack">
              <el-form ref="form" :model="quo" :rules="rules" label-width="100px" id="mvcfm">
                <el-button @click="gotoPage('/psi/supplychainmana/ProcurementContractSupply?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
                <div class="form-unit">
                  <span class="mvc-title-left"> 销售合同明细 </span>
                </div>
                <div>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="合同编号" prop="quo_num">
                        {{quo.quo_num}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="主题" prop="">
                        {{quo.quo_theme}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="供应商" prop="">
                        {{quo.quo_client}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="联系人" prop="">
                        {{quo.quo_contact}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="24">
                      <el-form-item label="供应商地址" prop="">
                        <div style="white-space: pre-wrap;">{{quo.quo_address}}</div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="订单日期" prop="quo_finishdate">
                        {{quo.quo_finishdate}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="12">
                      <el-form-item label="失效日期 " prop="">
                        {{quo.quo_faildate}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row>
                    <el-col :span="24">
                      <el-form-item label="内部备注" prop="">
                        <div style="white-space: pre-wrap;">{{quo.quo_insides}}</div>
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
                <div class="form-unit">
                  <span class="mvc-title-left"> 产品列表 </span>
                </div>
                <el-table :data="pum">
                  <el-table-column label="产品条形码" prop="product_barcode">
                  </el-table-column>
                  <el-table-column label="产品名称" prop="pronum_prodece">
                  </el-table-column>
                  <el-table-column label="产品型号" prop="product_model">
                  </el-table-column>
                  <el-table-column label="产品规格" prop="product_norm">
                  </el-table-column>
                  <el-table-column label="生产厂家" prop="client_name">
                  </el-table-column>
                  <el-table-column label="简要描述" prop="pronum_remark">
                  </el-table-column>
                  <el-table-column label="数量" prop="pronum_no">
                  </el-table-column>
                  <el-table-column label="单价" prop="pronum_price">
                  </el-table-column>
                  <el-table-column label="发货时间" prop="pronum_endate">
                    <template slot-scope="scope">
                      {{getDateTimeString(scope.row,'pronum_endate')}}
                    </template>
                  </el-table-column>
                  <el-table-column label="总价" prop="total_prices">
                  </el-table-column>
                </el-table>
                <div>
                  <el-row>
                    <el-col :span="24">
                      <el-form-item label="合计" prop="">
                        {{s_num.total_prices}}
                      </el-form-item>
                    </el-col>
                  </el-row>
                </div>
                <div class="form-unit">
                  <span class="mvc-title-left"> 甲乙双方责任 </span>
                </div>
                <el-table :data="s_duty">
                  <el-table-column label="备注" prop="duty_name">
                  </el-table-column>
                </el-table>
                <div class="form-unit">
                  <span class="mvc-title-left"> 付款方式 </span>
                </div>
                <el-table :data="s_pay">
                  <el-table-column label="首次付款" prop="pay_first">
                  </el-table-column>
                  <el-table-column label="二次付款" prop="pay_sec">
                  </el-table-column>
                  <el-table-column label="尾付款" prop="pay_end">
                  </el-table-column>
                </el-table>
                <div class="form-unit">
                  <span class="mvc-title-left"> 付款账号 </span>
                </div>
                <el-table :data="s_bank">
                  <el-table-column label="账户类型" prop="bank_type">
                  </el-table-column>
                  <el-table-column label="银行名称" prop="bank_tname">
                  </el-table-column>
                  <el-table-column label="开户姓名" prop="bank_name">
                  </el-table-column>
                  <el-table-column label="开户账号" prop="bank_account">
                  </el-table-column>
                </el-table>
                <div class="form-unit">
                  <span class="mvc-title-left"> 违约责任 </span>
                </div>
                <el-table :data="s_breakduty">
                  <el-table-column label="备注" prop="break_name">
                  </el-table-column>
                </el-table>
                <div class="form-unit">
                  <span class="mvc-title-left"> 其他要求 </span>
                </div>
                <el-table :data="s_demand">
                  <el-table-column label="备注" prop="demand_name">
                  </el-table-column>
                </el-table>
              </el-form>
            </td>
          </tr>
        </table>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'供应商'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
    <el-dialog :visible.sync="UpResponsibilityVisible" append-to-body>
      <UpResponsibility v-if="UpResponsibilityVisible" ref="UpResponsibility" :popparams="popparams"> </UpResponsibility>
    </el-dialog>
    <el-dialog :visible.sync="PaymentMethodSuppsVisible" append-to-body>
      <PaymentMethodSupps v-if="PaymentMethodSuppsVisible" ref="PaymentMethodSupps" :popparams="popparams"> </PaymentMethodSupps>
    </el-dialog>
    <el-dialog :visible.sync="UpIncreaseBankSupplyVisible" append-to-body>
      <UpIncreaseBankSupply v-if="UpIncreaseBankSupplyVisible" ref="UpIncreaseBankSupply" :popparams="popparams"> </UpIncreaseBankSupply>
    </el-dialog>
    <el-dialog :visible.sync="ModifyLiabilityContractVisible" append-to-body>
      <ModifyLiabilityContract v-if="ModifyLiabilityContractVisible" ref="ModifyLiabilityContract" :popparams="popparams"> </ModifyLiabilityContract>
    </el-dialog>
    <el-dialog :visible.sync="ModifOtherRequireVisible" append-to-body>
      <ModifOtherRequire v-if="ModifOtherRequireVisible" ref="ModifOtherRequire" :popparams="popparams"> </ModifOtherRequire>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import UpResponsibility from "@/views/psi/supplychainmana/UpResponsibility";
  import PaymentMethodSupps from "@/views/psi/supplychainmana/PaymentMethodSupps";
  import UpIncreaseBankSupply from "@/views/psi/supplychainmana/UpIncreaseBankSupply";
  import ModifyLiabilityContract from "@/views/psi/supplychainmana/ModifyLiabilityContract";
  import ModifOtherRequire from "@/views/psi/supplychainmana/ModifOtherRequire";
  export default {
    name: 'ContractSupply',
    components: {
      UpResponsibility,
      PaymentMethodSupps,
      UpIncreaseBankSupply,
      ModifyLiabilityContract,
      ModifOtherRequire,
    },
    props: ['popparams'],
    data() {
      return {
        UpResponsibilityVisible: false,
        UpResponsibilityValue: null,
        UpResponsibilityDesc: null,
        PaymentMethodSuppsVisible: false,
        PaymentMethodSuppsValue: null,
        PaymentMethodSuppsDesc: null,
        UpIncreaseBankSupplyVisible: false,
        UpIncreaseBankSupplyValue: null,
        UpIncreaseBankSupplyDesc: null,
        ModifyLiabilityContractVisible: false,
        ModifyLiabilityContractValue: null,
        ModifyLiabilityContractDesc: null,
        ModifOtherRequireVisible: false,
        ModifOtherRequireValue: null,
        ModifOtherRequireDesc: null,
        vueparams: this.getVUEParams(""),
        quo: {
          quo_num: null,
          quo_theme: null,
          quo_client: null,
          quo_contact: null,
          quo_address: null,
          quo_finishdate: null,
          quo_faildate: null,
          quo_insides: null,
        },
        pum: [],
        s_num: {
          total_prices: null,
        },
        s_duty: [],
        s_pay: [],
        s_bank: [],
        s_breakduty: [],
        s_demand: [],
        loading: false,
        Container: null,
        Container2: null,
        rules: {}
      }
    },
    created() {
      this.getData();
      this.loadContainerMenu({
        pid: "821959E4C08E497BA9C4B10D9571712F",
        name: "采购任务右菜单",
        selected: "供应商"
      }, 'Container', this.vueparams);
      this.loadContainerMenu({
        pid: "821959E4C08E497BA9C4B10D9571712F",
        name: "供应商详情",
        selected: "采购合同"
      }, 'Container2', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/ProcureSupplyAction/contractSupply?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      popUpResponsibility(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.UpResponsibilityVisible = !this.UpResponsibilityVisible;
      },
      popPaymentMethodSupps(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.PaymentMethodSuppsVisible = !this.PaymentMethodSuppsVisible;
      },
      popUpIncreaseBankSupply(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.UpIncreaseBankSupplyVisible = !this.UpIncreaseBankSupplyVisible;
      },
      popModifyLiabilityContract(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.ModifyLiabilityContractVisible = !this.ModifyLiabilityContractVisible;
      },
      popModifOtherRequire(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.ModifOtherRequireVisible = !this.ModifOtherRequireVisible;
      },
    },
  }
</script>
